<template>
    <div class="record-detail">
      <el-form v-if="form" ref="form" :model="form" label-width="150px">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="font-weight:bold; ">管理信息</span>
          </div>

            <el-col :span="12">
             <el-form-item label="场站名称：">{{form.stationName }}</el-form-item>
              <el-form-item label="场站编号：" >{{form.stationCode}}</el-form-item>
            </el-col>


          <!--<el-col :span="12">
            <el-form-item label="内部流水号：" >{{form.serialNumber}}</el-form-item>
            <el-form-item label="称重设备编号：" >{{form.deviceCode}}</el-form-item>
          </el-col>-->
          <el-col :span="12">
            <el-form-item label="运单编号：" >{{form.goodsCode}}</el-form-item>
            <el-form-item label="称重时间：" >{{form.weightTime}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="操作人：" >{{form.operatorName}}</el-form-item>
          </el-col>
        </el-card>

        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span style="font-weight:bold;">称重信息</span>
          </div>
          <el-col :span="12">
             <el-form-item label="车牌号码：" >{{form.plantNo}}</el-form-item>
             <el-form-item label="挂车车牌：" >{{form.plantNoGua}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车牌颜色：" >{{form.plantColor}}</el-form-item>
            <el-form-item label="称重总重(单位kg)：" >{{form.grossWeight}}</el-form-item>
<!--            <el-form-item label="是否超重(场站判定)：" >{{isOverWeightFormat(form)}}</el-form-item>-->

          </el-col>
          <!--<el-col :span="12">
            <el-form-item label="核定总重(单位kg)：" >{{form.CoTotalMass}}</el-form-item>
            <el-form-item label="净重(单位kg)：" >{{form.netWeight}}</el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="车轴数：" >{{form.CoAxleNumber}}</el-form-item>
            <el-form-item label="空重(单位kg)：" >{{form.emptyWeight}}</el-form-item>
          </el-col>-->
<!--          <el-row>-->
<!--            <el-form-item label="挂车车牌：" >{{form.plantNoGua}}</el-form-item>-->
<!--          </el-row>-->

          <el-row>
            <el-col :span="12">
              <!-- zPlatePhoto rearSidePhoto -->
              <el-form-item label="车辆侧前方图片:">
              <!--  <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">-->
               <el-image :preview-src-list="srcList" :src="form.zPlatePhoto">
                 <div slot="error" class="image-slot">
                   无
                 </div>
               </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="车辆侧后方图片:" v-if="form.rearSidePhoto != null && form.rearSidePhoto != ''">
                <el-image :preview-src-list="srcList"  :src="form.rearSidePhoto">
                  <div slot="error" class="image-slot">
                    无
                  </div>
                </el-image>
              </el-form-item>
              <el-form-item label="车辆侧后方图片:" v-else>
                无
              </el-form-item>
            </el-col>
          </el-row>
          <!--<el-row>
            <el-col :span="12">
              <el-form-item label="识别侧前方车牌：" >{{form.disBefPlanno }}</el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="识别侧后方车牌：" >{{form.disAfPlanno }}</el-form-item>
            </el-col>
          </el-row>-->
        </el-card>
      </el-form>
    </div>
</template>
<script>
import { getRecord } from "@/api/weight/record";
export default {
    data(){
        return{
            // 表单参数
            form: null,
            srcList:[],
             // 是否超重
            dict_isOverWeight: [],
        }
    },
    created(){
        this.getDicts("is_over_weight").then(response => {
            this.dict_isOverWeight = response.data;
        });
    },
    mounted(){
        this.GetRecordDetail()
    },
    methods:{
        //详细信息
        GetRecordDetail() {

            const id = this.$route.query.id
            getRecord(id).then(response => {
                this.form = response.data;
                this.srcList.push(this.form.zPlatePhoto)
                this.srcList.push(this.form.rearSidePhoto)
            });

        },
         isOverWeightFormat(form) {
            return this.selectDictLabel(this.dict_isOverWeight, form.isOverWeight);
        }
    }
}
</script>


<style scoped>
    .record-detail{
        width: 100%;
        padding: 20px;
        box-sizing: border-box;
    }
</style>
